package com.putable.nmc.dmv;

import com.putable.nmc.world.CIT;
import com.putable.nmc.world.CustomerType;
import com.putable.nmc.world.World;
import com.putable.pqueue.PQueue;
/**
 * 
 * @author Todd
 *
 * Is something that can be put in the CustomerLine. Has references to the customer in front
 * and the Customer behind. Also has some necessary variables for the CustomerLine
 */
public abstract class CLineAble extends PQElement  {

	public CLineAble(){
		setState(CustomerState.ARRIVED.getInitialState());
	}
	/**
	 * Main Constructor for CLineAble
	 * @param pq The Priority Queue
	 * @param cit This customers CIT
	 * @param world The world this DMV is in. Used for doing the exit interview on customers.
	 */
	public CLineAble(PQueue pq, CIT cit, World world){
		super(pq);
		this.setType(cit.getType());
		this.cit = cit;
		this.world = world;
		setState(CustomerState.ARRIVED);
	}
	
	private CIT cit;
	
	
	public CIT getCit() {
		return cit;
	}

	/**
	 * @param custBehind The customer behind this customer in line
	 */
	private CLineAble custBehind;
	
	public CLineAble getCustBehind() {
		return custBehind;
	}
	
	public void setCustBehind(CLineAble c) {
		custBehind = c;
	}

	/**
	 * @param custInFront The customer in front of this one in line
	 */
	private CLineAble custInFront;
	
	public void setCustInFront(CLineAble custInFront) {
		this.custInFront = custInFront;
	}

	public CLineAble getCustInFront() {
		return custInFront;
	}
	/**
	 * The world the DMV is in. Used for doing the exit interview of the customers.
	 */
	private World world;
	
	public World getWorld() {
		return world;
	}
	/**
	 * The type of customer this one is. A customer can be a Biker, a Worker, a Student,
	 * or a Retiree
	 * @return The Customer type of this CLineAble
	 */
	public abstract CustType getType();
	public abstract void setType(CustomerType t);
}
